This script is the repeatable script for measuring changes in the different diversity metrics and how they are affected by the different stressors. In this section we are going to analyse the results from the optim.replicates chain

Results per metrics

Here I'm going to display the results in box plot for each metric in each broad category. > We can probably think of a better way to display the results in the future.

For each metric displayed here:

Scaling and centring the results

We centre the metric based on the null results by substracting the score of the metric from the randomly reduced trait space to the stressed trait space (i.e. \(score_{centred} = score_{stressed} - score_{random}\)). We then scale the centred metric by dividing it by it's maximum absolute centred value between all stressors (i.e. \(score_{scaled} = score_{centred} / \text{max}(|scores_{centred}|))\)).

Measuring the statistics for each metric

To measure the differences between the random and stressed metric scores, we ran paired t-tests between each pairs of unscaled metric score for the random reduction of the trait space and the stressed reduction of the trait space (t.test(random_scores, stressor_scores, paired = TRUE)).

To check the trend in the different level of data removals (20, 40, 60 and 80%) using a linear model with the \(scores_{scaled}\) as a response to the different removal levels (lm(scaled_metric ~ removal_level).

Results of the model scaled metric ~ removal level per stressor
equalizing.Slope equalizing.adj.R^2 facilitation.Slope facilitation.adj.R^2 filtering.Slope filtering.adj.R^2 competition.Slope competition.adj.R^2
tree_alpha 0.112*** 0.713 0.062*** 0.464 0.059*** 0.092 0.022*** 0.116
tree_dispersion 0.09*** 0.455 0.023*** 0.113 0.04*** 0.044 0.016*** 0.101
tree_evenness 0 -0.001 0.004*** 0.167 -0.003 -0.001 0.002*** 0.032
FD_Rao 0.131*** 0.616 0.005 0.001 0.004 -0.001 0.003 0
FD_divergence -0.046*** 0.074 0.005 -0.001 -0.001 -0.001 0.026*** 0.027
FD_evenness 0.004. 0.003 0.189*** 0.87 0.008 0.001 0.015*** 0.06
melodic_Rao 0.165*** 0.903 0.039*** 0.173 0.075*** 0.177 0.032*** 0.192
melodic_mpd 0.167*** 0.895 0.038*** 0.158 0.076*** 0.186 0.032*** 0.172
convex.hull 0.042*** 0.098 0.014*** 0.015 0.033*** 0.05 0.015*** 0.024
hypervolume_richness 0.034*** 0.066 -0.001 -0.001 0.017** 0.013 0.004 0
hypervolume_dispersion 0.105*** 0.545 0.018*** 0.038 0.049*** 0.096 0.012*** 0.03
hypervolume_regularity -0.001 -0.001 0.004 -0.001 0.064*** 0.093 0.015** 0.009
TPD_Richness 0.084*** 0.393 0.026*** 0.085 0.05*** 0.099 0.02*** 0.066
TPD_Evenness 0.24*** 0.637 0.044*** 0.037 0.111*** 0.199 0.018** 0.008
TPD_Divergence 0.176*** 0.618 0.01. 0.003 0.087*** 0.15 0.042*** 0.084
Average difference between the null metric and the stressed metric (raw) for each level of removal and each stressor
equa.rm1 equa.rm2 equa.rm3 faci.rm1 faci.rm2 faci.rm3 filt.rm1 filt.rm2 filt.rm3 comp.rm1 comp.rm2 comp.rm3
tree_alpha 31.477*** 37.305*** 34.81*** 23.064*** 30.805*** 31.594*** 24.364*** 30.483*** 32.403*** 8.065*** 11.123*** 11.106***
tree_dispersion 0.228*** 0.151*** 0.1*** 0.081*** 0.069*** 0.053*** 0.154*** 0.118*** 0.094*** 0.064*** 0.054*** 0.046***
tree_evenness 0 0** 0** 0.002*** 0* 0 0.01*** 0.01*** 0.011*** 0.001*** 0. 0**
FD_Rao 2.799*** 2.047*** 1.407*** 0.887*** 0.798*** 0.645*** 1.267*** 1.137*** 0.934*** 0.735*** 0.63*** 0.536***
FD_divergence -0.045*** -0.041*** -0.034*** -0.006. -0.003 -0.006*** -0.004 -0.01*** -0.004 0.012*** 0.001 0.001
FD_evenness -0.028*** -0.036*** -0.035*** 0.255*** 0.161*** 0.067*** 0.02** 0.021*** 0.013* 0.028*** 0.025*** 0.018***
melodic_Rao 0.173*** 0.12*** 0.082*** 0.058*** 0.049*** 0.039*** 0.108*** 0.082*** 0.064*** 0.051*** 0.041*** 0.035***
melodic_mpd 0.177*** 0.121*** 0.083*** 0.059*** 0.049*** 0.039*** 0.109*** 0.081*** 0.063*** 0.053*** 0.041*** 0.035***
convex.hull 38.128*** 43.105*** 41.169*** 20.963*** 23.36*** 23.19*** 30.242*** 32*** 30.807*** 11.358*** 12.664*** 11.098***
hypervolume_richness 65.974*** 55.474*** 44.959*** 30.603*** 27.608*** 23.517*** 49.959*** 40.682*** 33.453*** 23.359*** 20.178*** 17.03***
hypervolume_dispersion 3.101*** 2.413*** 1.831*** 0.997*** 0.865*** 0.729*** 2.01*** 1.573*** 1.286*** 0.728*** 0.622*** 0.542***
hypervolume_regularity -0.006 -0.004 -0.006. 0.007 0.013** 0.009** 0.091*** 0.07*** 0.057*** 0.028*** 0.022*** 0.021***
TPD_Richness 68.84*** 70.55*** 63.552*** 32.991*** 34.906*** 33.619*** 49.634*** 49.58*** 46.529*** 17.838*** 18.872*** 16.442***
TPD_Evenness 0.086*** 0.041*** 0.008*** 0.018*** 0.017*** 0.009*** 0.054*** 0.035*** 0.018*** 0.043*** 0.037*** 0.034***
TPD_Divergence 0.106*** 0.043*** 0.006** -0.002 -0.003 -0.007** 0.045*** 0.006 -0.01** 0.046*** 0.033*** 0.03***

Plots per stressor

Figure X1: Simulation results: the y axes represent the different metrics tested (sorted by categories). The different columns represent the different stressors. The x-axes represent the metric values centred on the random changes and scaled by the maximum value for each metric between the four stressors. Negative and positive values signify a decrease/increase in the metric score. The dots represent the median metric value, the full line their 50% confidence interval (CI) and the dashed line their 95% CI. The colours are just here to visually separate the metrics rows but the colour gradient within each row corresponds to a removal of respectively 80%, 60%, 40% and 20% of the data (from top to bottom).

Figure X2: See above + Grey lines in the background are a fitted linear model on the scaled metric score function of removal amount and the value displayed is the adjusted R^2 from each of these models. Dashed grey lines represent non-significant models (slope or/and intercept). The grey line plots represent (CI + median) represent distribution of metrics scores not clearly different from the random metric scores (paired t-test p value > 0.05).

I think that Figure X2 would do a good summary of how the metrics pick up changes. Here's a couple of interpretations of it in the light of my previous work on which metric to choose: * Don't use the TPD richness metric, it doesn't do much. * On the other hand, hypervolume regularity and richness are two good metrics because they only pick up really specific changes (respectively "equalizing" and "facilitation") and nothing else.

Results interpretations in the light of our expectation table

These were our expectations:

Mechanism Richness Dispersion Regularity
Equalizing Lower Lower Higher
Facilitation Higher Higher Higher
Filtering (exclusion) Higher Higher Higher
Competition Lower Lower Nothing

And these are our results per metric family:

NOTE: the difference between [ok] and [-ok] is actually not really meaningful here since these graphs shows differences compared to the null results so if both the null and stressor results increase but the stressor increases slowlier than the stressor, the results in the table will decrease. Although in general, if this is the case, this is a "bad" results since ideally we would want the null to not change at all (i.e. if the metric is just picking up changes in number of elements, this is not really useful).

Tree (dissimilarity)

Mechanism Richness (alpha) Dispersion Regularity
Equalizing [ok] Lower [ok] Lower [-ok] Higher
Facilitation [NO] Higher [-ok] Higher [-ok] Higher
Exclusion [NO] Higher [-ok] Higher [-ok] Higher
Competition [ok] Lower [ok] Lower [NO] Nothing

FD

Mechanism Richness (Rao) Dispersion Regularity
Equalizing [NO] Lower [ok] Lower [-ok] Higher
Facilitation [NO] Higher [-ok] Higher [NO] Higher
Exclusion [-ok] Higher [-ok] Higher [-ok] Higher
Competition [ok] Lower [ok] Lower [NO] Nothing

hypervolume

Mechanism Richness (Rao) Dispersion Regularity
Equalizing [NO] Lower [-ok] Lower [-ok] Higher
Facilitation [-ok] Higher [NO] Higher [NO] Higher
Exclusion [NO] Higher [NO] Higher [NO] Higher
Competition [ok] Lower [NO] Lower [ok] Nothing

TPD

Mechanism Richness (Rao) Dispersion Regularity
Equalizing [NO] Lower [ok] Lower [-ok] Higher
Facilitation [NO] Higher [-ok] Higher [-ok] Higher
Exclusion [NO] Higher [-ok] Higher [-ok] Higher
Competition [NO] Lower [ok] Lower [NO] Nothing

Other

I actually don't remember of the top of my head what the convex.hull and melodic rao/mpd are representing.

Metrics correlations

And finally below are all the correlations per stressor between each metric per removal levels (20, 40, 60, 80%).

TODO: do the PCA plots as suggested by Carlos to see things clearlier.

Equalizing

Metrics correlation for equalizing with 20% removal

Metrics correlation for equalizing with 40% removal

Metrics correlation for equalizing with 60% removal

Metrics correlation for equalizing with 80% removal

Facilitation

Metrics correlation for facilitation with 20% removal

Metrics correlation for facilitation with 40% removal

Metrics correlation for facilitation with 60% removal

Metrics correlation for facilitation with 80% removal

Filtering

Metrics correlation for filtering with 20% removal

Metrics correlation for filtering with 40% removal

Metrics correlation for filtering with 60% removal

Metrics correlation for filtering with 80% removal

Competition

Metrics correlation for competition with 20% removal

Metrics correlation for competition with 40% removal

Metrics correlation for competition with 60% removal

Metrics correlation for competition with 80% removal